import {createRouter, createWebHistory} from 'vue-router'
import type {RouteRecordRaw} from 'vue-router'
// 配置路由信息
const routes: RouteRecordRaw[] = [
    {
        path: '/',
        redirect: '/home',
    },
    {
        name: 'login',
        path: '/login',
        component: () => import('/@/views/loginplus/index.vue'),
    },
    {
        name: 'home',
        path: '/home',
        component: () => import('/@/views/home/index.vue'),
        redirect: '/home/article',
        children: [
            {
                name: 'user',
                path: '/home/user',
                redirect: "/home/user/admin",
                component: () => import('/@/views/home/user/user.vue'),
                children: [
                    {
                        name: "admin-user",
                        path: "/home/user/admin",
                        component: () => import('/@/views/home/user/allUser.vue')
                    }
                ]
            },
            {
                name: 'model',
                path: '/home/index',
                component: () => import('/@/views/home/model/index.vue')
            },
            {
                name: 'dike',
                path: '/home/dike',
                component: () => import('/@/views/dike/index.vue')
            },
            {
                name: 'article',
                path: '/home/article',
                component: () => import('/@/views/article/index.vue')
            },
            {
                name: 'article-item',
                path: '/home/article-item',
                component: () => import('/@/views/article/edit.vue')
            }
        ],
    },

]

const router = createRouter({
    routes,
    history: createWebHistory(),
})

export default router
